package com.nulldev.util.web.nTube.components.video_queue;

import java.util.NoSuchElementException;
import java.util.concurrent.LinkedBlockingQueue;

public class WaitableLinkedBlockingQueue<E> extends LinkedBlockingQueue<E> implements WaitableQueue<E> {

	private static final long serialVersionUID = 4362739007731689116L;

	public WaitableLinkedBlockingQueue() {
		super();
	}

	public WaitableLinkedBlockingQueue(final int size) {
		super(size);
	}

	@Override
	public E waitForItem() {
		try {
			return take();
		} catch (InterruptedException e) {
			throw new NoSuchElementException();
		}
	}
}
